/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.open.test.base;

import cn.hutool.core.collection.ListUtil;
import com.alibaba.fastjson2.JSON;
import com.google.common.collect.Lists;
import info.peigen.hotpot.business.fee.core.domain.FeeContext;
import info.peigen.hotpot.common.core.domain.Address;
import info.peigen.hotpot.common.core.lang.money.Money;
import info.peigen.hotpot.common.service.base.test.ServiceTestBaseMockConstant;
import info.peigen.hotpot.common.service.base.time.TimeRange;

import java.time.LocalTime;
import java.util.List;

/**
 * <b>(OpenApiTestBaseMockConstant)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/7/28
 */
public interface OpenApiTestBaseMockConstant extends ServiceTestBaseMockConstant {
    String       MOBILE_NO                 = "13988888888";
    String       CERT_NO                   = "430381199705136019";
    String       EMAIL                     = "yyy@peigen.info";
    String       LOGIN_CODE                = "123456";
    String       FEE_RULE_NAME             = "测试收费规则-peigen";
    String       FEE_ACCOUNT_ALIAS_NAME    = "测试收费账户-peigen";
    String       OPEN_ID                   = "abcd";
    String       CUSTOMER_NICK_NAME        = "Peigen_info";
    String       PARTNER_NAME              = "卡卡重构";
    String       STATION_PARENT_NAME       = "卡卡小站";
    String       STATION_NAME              = "卡卡小站负一楼";
    String       STATION_FLOOR             = "1F";
    List<String> STATION_AREA              = ListUtil.toList("南区", "北区");
    String       STUB_ID                   = "202208151708408833980001";
    String       BATTERY_MEMO              = "测试电池-Peigen";
    String       ROBOT_NAME                = "小叮当";
    String       ROBOT_MEMO                = "测试机器人-Peigen";
    String       STUB_PORT                 = "02";
    String       STUB_PROTOCOL_VERSION     = "15";
    Address      ADDRESS                   = Address.builder().provinceName("重庆").cityName("重庆")
            .streetName("人和").addressStr("人和立交支路5号").build();
    String       STUB_PROGRAM_VERSION      = "v4.1.50";
    String       STUB_NETWORK_CONNECT_TYPE = "01";
    String       FEE_RULE_CONTENT          = feeRuleContext();

    static String feeRuleContext() {
        TimeRange firstTimeRange = TimeRange.builder()
                .startTime(LocalTime.of(00, 00, 00))
                .endTime(LocalTime.of(8, 00, 00))
                .build();
        TimeRange secondTimeRange = TimeRange.builder()
                .startTime(LocalTime.of(8, 00, 00))
                .endTime(LocalTime.of(00, 00, 00))
                .build();
        List<FeeContext> contexts = Lists.newArrayList(
                FeeContext.builder().timeRange(firstTimeRange).chargeFee(Money.amount("1.0")).build(),
                FeeContext.builder().timeRange(secondTimeRange).chargeFee(Money.amount("1.3")).build()
        );
        return JSON.toJSONString(contexts);
    }
}